#include "head.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define BUFFERSIZE 4096
int main(int argc,char *argv[])
{
	int fd=open(argv[2],O_RDONLY,0);
	char ch[BUFFERSIZE];
	int size=read(fd, &ch,BUFFERSIZE);
	
	close(fd);
	if(strcmp(argv[1], "head")==0) {
		newHead(ch,size);
	}
	else if(strcmp(argv[1],"tail")==0) {
		newTail(ch,size);
	}
	return 0;
}
